<script type="text/javascript">
var timer = null;
// <![CDATA[
function ajax_init_topic_preview(f, t)
{
	document.getElementById('topic_preview').style.display='none';
	clearTimeout(timer);
	timer=setTimeout('ajax_topic_preview('+f+','+t+')',1000);
}

function ajax_hide_topic_preview()
{
	clearTimeout(timer);
	timer=setTimeout("document.getElementById('topic_preview').style.display='none'",1000);
}

function ajax_topic_preview(f, t)
{
	var div = document.getElementById('topic_preview');
	div.style.display = "block";
	div.innerHTML = "{L_LOADING}";
	// Create new JsHttpRequest object.
	var req = new JsHttpRequest("utf-8");
	// Turn on caching
	req.caching = true;
	// Code automatically called on load finishing.
	req.onreadystatechange = function()
	{
		if (req.readyState == 4)
		{
			if(req.responseText)
			{
				div.innerHTML = req.responseText;
			}
			else
			{
			}
		}
	}
	// Prepare request object (automatically choose GET or POST).
	req.open(null, 'aljax.php', true);
	// Send data to backend.
	req.send( {mode:'topic_preview', f:f, t:t} );

}

// ]]>
</script>
<div class="pm_preview" style="display:none;top:0;left:0;" id="topic_preview" onmouseover="clearTimeout(timer);" onmouseout="ajax_hide_topic_preview()">
</div>
